//
//  NSUserNotification+Quick.m
//  iChatShortcut
//
//  Created by Meniny on 2017-05-16.
//  Copyright © 2017年 Meniny. All rights reserved.
//

#import "NSUserNotification+Quick.h"

@implementation NSUserNotification (Quick)
+ (void)notification:(NSString *)title
             message:(NSString *)message
               image:(NSImage *)image
               sound:(BOOL)sound
          identifier:(NSString *)identifier {
    
    NSUserNotification *notification = [NSUserNotification new];
    notification.title = title;
    notification.informativeText = message;
    if (image) {
        notification.contentImage = image;
    }
    notification.soundName = sound ? NSUserNotificationDefaultSoundName : nil;
    if (identifier) {
        notification.identifier = [NSString stringWithFormat:@"%@_%@", identifier, [NSDate date]];
    }
    
//    [NSUserNotificationCenter defaultUserNotificationCenter].delegate = self;
    [[NSUserNotificationCenter defaultUserNotificationCenter] scheduleNotification:notification];
}
@end
